# 编译启动
all:
	# up cloud disk api service in sub dir
	make -C service

# 启动docker-compose
up-docker:
	# require docker-compose
	docker-compose up -d 

# 生成api代码
gen-api:
	# require goctl
	goctl api go -api service/service.api -dir service -style go_zero

# 测试服务是否正确启动
test-health:
	# require httpie
	http :8888

# 下载goreleaser
download-goreleaser:
	# use mirror download
	wget https://ghproxy.cn/https://github.com/goreleaser/goreleaser/releases/download/v2.9.0/goreleaser_Linux_x86_64.tar.gz

# 使用goreleaser打包发布
dist-with-goreleaser:
	# require goreleaser in PATH
	goreleaser --snapshot --clean
	-mkdir dist/etc
	-cp service/etc/service-api.yaml dist/etc/service-api.yaml
	-cp docker-compose.yml dist/etc/docker-compose.yml
	@echo "NOTICE: >>>>>>>>>> 请复制etc/service-api.yaml文件出来到dist需要的路径 <<<<<<<<<<<"
	@echo "NOTICE: >>>>>>>>>> docker-compose up -d first<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"

check-readme-hash:
	sha256sum readme.md 